package com.gxc.controller;

import java.util.HashMap;
import java.util.Map;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 点餐系统.
 *
 * @author 宫新程
 * @since 2019/3/1 9:05
 */
@RestController
public class CookeController {

  /** 提交菜单. */
  @PostMapping("/submit")
  public Map<String, String> submit(@RequestBody Map<String, Map<String, String>> map) {

    map.forEach(
        (k, v) -> {
          System.out.println("id：" + k);
          v.forEach((k1, v1) -> System.out.println(k1 + "：" + v1));
          System.out.println("=================");
        });

    Map<String, String> result = new HashMap<>();
    result.put("success", "true");
    return result;
  }
}
